package org.example.lotterysystem.controller.param;

import jakarta.validation.constraints.NotBlank;

import java.util.Objects;

public class ShortMessageLoginParam extends UserLoginParam{
    /**
     * 电话号码
     */
    @NotBlank(message = "电话号码不能为空！")
    private String loginMobile;

    /**
     * 验证码
     */
    @NotBlank(message = "验证码不能为空！")
    private String verificationCode;

    public String getLoginMobile() {
        return loginMobile;
    }

    public void setLoginMobile(String loginMobile) {
        this.loginMobile = loginMobile;
    }

    public String getVerificationCode() {
        return verificationCode;
    }

    public void setVerificationCode(String verificationCode) {
        this.verificationCode = verificationCode;
    }

    @Override
    public boolean equals(Object object) {
        super.equals(object);
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        ShortMessageLoginParam that = (ShortMessageLoginParam) object;
        return Objects.equals(loginMobile, that.loginMobile) && Objects.equals(verificationCode, that.verificationCode);
    }

    @Override
    public int hashCode() {
        return Objects.hash(loginMobile, verificationCode);
    }
}
